<?php
/**
 * Created by PhpStorm.
 * User: chl
 * Date: 2017/3/17 0017
 * Time: 10:21
 */
namespace app\admin\validate;
use think\Validate;
class Admin extends Validate{
   //定义规则
    protected $rule = [
        'username'  => 'unique:admin',
        'password' => 'require|confirm:pwds',
        'pwds'     => 'require',
    ];
    //定义错误信息
    protected $message = [
        'username.unique'    => '登录名必须唯一',
        'password.require'  => '密码不能为空',
        'pwds.require'   => '确定密码不能为空'
    ];
    //验证场景
    protected $scene = [
        'adminAdd'  =>  ['username','password'],
    ];

}